package rkdwogus7.practice;

public class Ch04_Sil1_v2 {

	public static void main(String[] args) {
		Song2 s2 = new Song2();
		s2 = new Song2("ABBA", "Dancing Queen", "The Albums", new String[] {"Benny Anderson", "Björn Ulvaeus", "Stig Anderson"}, 1976, "1");
		
		System.out.println( s2.toString() );
		
	}

	
	
	
}

class Song2 {
	private String title;
	private String artist;
	private String album;
	private String[] composer;
	private int year;
	private String track;
	
	public Song2() {  }
	public Song2(String title, String artist, String album, String[] composer, int year, String track) {
		this.title = title;
		this.artist = artist;
		this.album = album;
		this.composer = composer;
		this.year = year;
		this.track = track;
	}
	
	public void setTitle(String title) {
		this.title = title;
	}
	public String getTitle() {
		return title;
	}
	
	public void setArtist(String artist) {
		this.artist = artist;
	}
	public String getArtist() {
		return artist;
	}
	
	public void setAlbum(String album) {
		this.album = album;
	}
	public String getAlbum() {
		return album;
	}
	
	public void setComposer(String[] composer) {
		this.composer = composer;
	}
	public String[] getComposer() {
		return composer;
	}
	
	public void setYear(int year) {
		this.year = year;
	}
	public int getYear() {
		return year;
	}
	
	public void setTrack(String track) {
		this.track = track;
	}
	public String getTrack() {
		return track;
	}
	
	
	
	
	
	
	
	public String toString() {
		String result = "";
		result += "타이틀 : " + title;
		result += "가수 : " + artist;
		result += "앨범 : " + album;
		result += "작곡가 : ";
		for(int i = 0; i < composer.length; ++i) {
			result += composer[i];
		}
		result += "발표연도 : " + Integer.toString(year);
		result += "트랙번호 : " + track;
		
		return result;
	}
	
	
	
}






